package com.wsj.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.core.env.EnvironmentCapable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class UserController implements EnvironmentAware {

  private Environment environment = null;

  private static final Logger logger = LoggerFactory.getLogger(UserController.class);

  @RequestMapping(value = "/register", method = RequestMethod.POST)
  public String register(Model model) {
    logger.info("register......");
    model.addAttribute("user", "houyangyang");
    return "index";
  }

  @Override
  public void setEnvironment(Environment environment) {
    this.environment = environment;
  }
}
